//
//  PKAgreementViewController.swift
//  Panku
//
//  Created by mac on 2017/2/17.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKAgreementViewController: PKBaseViewController {

    //MARK: - properties
    lazy var webView:PKBaseWebView = PKBaseWebView()
    
    //MARK: - life circle
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    override func setupRootView() {
        view.backgroundColor = UIColor.white
    }
    
    override func setupSubViews() {
        view.addSubview(webView)
        
        let path = Bundle.main.path(forResource: "放克直播条款", ofType: "doc")
        let url = URL(fileURLWithPath: path!)
        let request = URLRequest(url: url)
        webView.loadRequest(request)
        
        webView.scrollView.maximumZoomScale = 1
        webView.scrollView.minimumZoomScale = 1
        webView.scrollView.bounces = true
        
    }
    
    override func setupSubViewsConstraints() {
        webView.snp.makeConstraints { (make) in
            make.edges.equalTo(view)
        }
    }
    
    override func setupNavigationBar() {
        self.title = "放克直播条款"
        let dismissButton = PKBaseButton.createButton()
        dismissButton.setTitle("关闭", for: .normal)
        dismissButton.addBlock(for: .touchUpInside) { (_) in
            //dismiss
            self.dismiss(animated: true, completion: { 
                //finish callback
            })
        }
        dismissButton.titleLabel?.font = UIFont.systemFont(ofSize: 12)
        dismissButton.setTitleColor(UIColor.black, for: .normal)
        dismissButton.frame = CGRect(x: 0, y: 0, width: 44, height: 44)
        let dismissBarButtonItem = UIBarButtonItem(customView: dismissButton)
        self.navigationItem.rightBarButtonItem = dismissBarButtonItem
    }
    
    override func bindViewModel() {
        
    }


}
